def open_user_file
	print "File to open: "
	filename = gets.chomp
	begin
		fh = File.open(filename)
		yield fh
	rescue
		puts "Couldn't open your file!"
		raise
	ensure
		fh.close
	end
end


open_user_file {|fh| 
	lines = fh.readlines
	lines.each { |line| puts(line)}
}